<template>
  <el-dialog
    :title="'查看详情'"
    :close-on-click-modal="false"
    :visible.sync="visible">
    <el-form :model="dataForm" ref="dataForm" label-width="100px" @keyup.enter.native="modelClose()" class="demo-table-expand">
      <el-form-item label="真实姓名" prop="teacherName">
        <span>{{dataForm.teacherName}}</span>
      </el-form-item>
      <el-form-item label="登录用户名" prop="userName">
        <span>{{dataForm.userName}}</span>
      </el-form-item>
      <!--<el-form-item label="密码" prop="teacherPassword">
        <el-input v-model="dataForm.teacherPassword" placeholder="密码"></el-input>
      </el-form-item>-->
      <el-form-item label="性别" prop="teacherGender">
        <span>{{dataForm.gender}}</span>
      </el-form-item>
      <!--<el-form-item label="头像" prop="teacherHeader">
        <el-input v-model="dataForm.teacherHeader" placeholder="头像"></el-input>
      </el-form-item>-->
      <el-form-item label="手机号码" prop="teacherMobile">
        <span>{{dataForm.teacherMobile}}</span>
      </el-form-item>
      <!--<el-form-item label="状态：待审核（0），有效（1），无效（2）" prop="status">
        <el-input v-model="dataForm.status" placeholder="状态：待审核（0），有效（1），无效（2）"></el-input>
      </el-form-item>-->
      <el-form-item label="生日" prop="birthday">
        <span>{{dataForm.birthday}}</span>
      </el-form-item>
      <el-form-item label="学历" prop="teacherEducation">
        <span>{{dataForm.education}}</span>
      </el-form-item>
      <!-- <el-form-item label="大学编码" prop="collegeCode">
         <el-input v-model="dataForm.collegeCode" placeholder="大学编码"></el-input>
       </el-form-item>
       <el-form-item label="大学名称" prop="collegeName">
         <el-input v-model="dataForm.collegeName" placeholder="大学名称"></el-input>
       </el-form-item>
       <el-form-item label="资格证书编号" prop="certNo">
         <el-input v-model="dataForm.certNo" placeholder="资格证书编号"></el-input>
       </el-form-item>-->
      <el-form-item label="签名" prop="teacherSign">
        <span>{{dataForm.teacherSign}}</span>
      </el-form-item>
      <el-form-item label="微信号" prop="teacherWechat">
        {{dataForm.teacherWechat}}

      </el-form-item>
      <el-form-item label="qq号" prop="teacherQq">
        <span>{{dataForm.teacherQq}}</span>
      </el-form-item>
      <!-- <el-form-item label="户籍所在省份" prop="provinceId">
         <el-input v-model="dataForm.provinceId" placeholder="户籍所在省份"></el-input>
       </el-form-item>
       <el-form-item label="户籍所在城市" prop="cityId">
         <el-input v-model="dataForm.cityId" placeholder="户籍所在城市"></el-input>
       </el-form-item>
       <el-form-item label="户籍所在地区" prop="areaId">
         <el-input v-model="dataForm.areaId" placeholder="户籍所在地区"></el-input>
       </el-form-item>-->
      <el-form-item label="籍贯" prop="censusRegister">
        <span>{{dataForm.censusRegister}}</span>
      </el-form-item>
      <el-form-item label="身份证" prop="idCard">
        <span> {{dataForm.idCard}}</span>
      </el-form-item>
      <!--  <el-form-item label="现住住址" prop="currentAddress">
          <el-input v-model="dataForm.currentAddress" placeholder="现住住址"></el-input>
        </el-form-item>-->
      <!--<el-form-item label="最后一次登录IP" prop="loginIp">
        <el-input v-model="dataForm.loginIp" placeholder="最后一次登录IP"></el-input>
      </el-form-item>-->
      <!-- <el-form-item label="最后一次登录时间" prop="loginTime">
         <el-input v-model="dataForm.loginTime" placeholder="最后一次登录时间"></el-input>
       </el-form-item>-->
      <el-form-item label="创建人" prop="createUser">
        <span>{{dataForm.createUser}}</span>
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <span>{{dataForm.createTime}}</span>
      </el-form-item>
      <el-form-item label="修改人" prop="updateUser">
        <span>{{dataForm.updateUser}}</span>
      </el-form-item>
      <el-form-item label="修改时间" prop="updateTime">
        <span>{{dataForm.updateTime}}</span>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="modelClose()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  export default {
    data () {
      return {
        visible: false,
        dataForm: {
          teacherId: 0,
          teacherName: '',
          userName: '',
          teacherPassword: '',
          teacherGender: '',
          gender: '',
          teacherHeader: '',
          teacherMobile: '',
          status: '',
          birthday: '',
          teacherEducation: '',
          education: '',
          collegeCode: '',
          collegeName: '',
          certNo: '',
          teacherSign: '',
          teacherWechat: '',
          teacherQq: '',
          provinceId: '',
          cityId: '',
          areaId: '',
          censusRegister: '',
          idCard: '',
          currentAddress: '',
          loginIp: '',
          loginTime: '',
          createUser: '',
          createTime: '',
          updateUser: '',
          updateTime: ''
        }
      }
    },
    computed: {},
    methods: {
      init (id) {
        this.dataForm.teacherId = id || 0
        this.visible = true
        this.$nextTick(() => {
          this.$refs['dataForm'].resetFields()
          if (this.dataForm.teacherId) {
            this.$http({
              url: this.$http.adornUrl(`/operate/teacher/info/${this.dataForm.teacherId}`),
              method: 'get',
              params: this.$http.adornParams()
            }).then(({data}) => {
              if (data && data.code === 0) {
                this.dataForm.teacherName = data.teacher.teacherName
                this.dataForm.userName = data.teacher.userName
                this.dataForm.teacherPassword = data.teacher.teacherPassword
                this.dataForm.gender = data.teacher.gender
                this.dataForm.teacherHeader = data.teacher.teacherHeader
                this.dataForm.teacherMobile = data.teacher.teacherMobile
                this.dataForm.status = data.teacher.status
                this.dataForm.birthday = data.teacher.birthday
                this.dataForm.education = data.teacher.education
                this.dataForm.collegeCode = data.teacher.collegeCode
                this.dataForm.collegeName = data.teacher.collegeName
                this.dataForm.certNo = data.teacher.certNo
                this.dataForm.teacherSign = data.teacher.teacherSign
                this.dataForm.teacherWechat = data.teacher.teacherWechat
                this.dataForm.teacherQq = data.teacher.teacherQq
                this.dataForm.provinceId = data.teacher.provinceId
                this.dataForm.cityId = data.teacher.cityId
                this.dataForm.areaId = data.teacher.areaId
                this.dataForm.censusRegister = data.teacher.censusRegister
                this.dataForm.idCard = data.teacher.idCard
                this.dataForm.currentAddress = data.teacher.currentAddress
                this.dataForm.loginIp = data.teacher.loginIp
                this.dataForm.loginTime = data.teacher.loginTime
                this.dataForm.createUser = data.teacher.createUser
                this.dataForm.createTime = data.teacher.createTime
                this.dataForm.updateUser = data.teacher.updateUser
                this.dataForm.updateTime = data.teacher.updateTime
              }
            })
          }
        })
      },
      // 表单提交
      modelClose () {
        this.visible = false
      }
    }
  }
</script>
<style>
  .demo-table-expand {
    font-size: 0;
    overflow: hidden;
  }

  .demo-table-expand label {
    width: 100px;
    color: #99a9bf;
  }

  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
    float: left;
  }
</style>
